

//
//  FourTableViewCell.m
//  GoShops
//
//  Created by mac22 on 14/11/17.
//  Copyright (c) 2014年 郑朝军. All rights reserved.
//

#import "FourTableViewCell.h"
#import "Grouble.h"

@interface FourTableViewCell()
//// 左边的view
//@property (nonatomic,weak)UIImageView * leftView;
//// 右下边的view
//@property (nonatomic,weak)UIImageView * rightTopView;
//// 右下边的view
//@property (nonatomic,weak)UIImageView * rightBottomView;
//// 左上面的标题
//@property (nonatomic,weak)UILabel * leftTopbetweent;
//// 左边下面的标题
//@property (nonatomic,weak)UILabel * leftTopSunbetweent;
//
//@property (nonatomic,weak)UILabel * rightTop;
//@property (nonatomic,weak)UILabel * rightTopSun;
//@property (nonatomic,weak)UILabel * leftBottom;
//@property (nonatomic,weak)UILabel * leftBottomSun;


@end
@implementation FourTableViewCell

+(instancetype)FourTableViewCell:(UITableView *)tableView
{
    static NSString *ID = @"fourcell";
    FourTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
    if (cell == nil) {
        cell = [[FourTableViewCell alloc]initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:ID];
    }
    // 设置不能选中,选中每反应

    cell.selectionStyle = UITableViewCellSelectionStyleNone;
   
    return cell;
}
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        self.userInteractionEnabled = NO;
        self.backgroundColor = ZCJColor(237, 237, 242);
        UIView * backView = [[UIView alloc]initWithFrame:CGRectMake(0, 10, ScreenWidth, 80)];
        backView.backgroundColor = ZCJColor(207, 208, 208);
        [self addSubview:backView];
        
        // 为什么会这样，因为图片的宽度
        UIImageView * leftView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 80, 80)];
        
        
        [leftView setImageWithURL:nil placeholderImage:[UIImage imageNamed:@"bg_customReview_image_default"]];
        leftView.contentMode = UIViewContentModeCenter;
        //leftView.layer.masksToBounds = YES;
        
        leftView.layer.cornerRadius = 60;
        
        [backView addSubview:leftView];
        NSString * topStr = @"庐山正在等着你呢？";
        NSString * topSunStr = @"一大波游客来袭，意味着优惠就多";
        
        CGSize topStrSize = [topStr sizeWithAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:20]}];
        
        CGSize topSunStrSize = [topSunStr sizeWithAttributes:@{NSFontAttributeName: [UIFont systemFontOfSize:18]}];
        
        
        UILabel * TopLable = [[UILabel alloc]initWithFrame:CGRectMake(90, 20, topStrSize.width, topStrSize.height)];
      
        TopLable.text = topStr;
        TopLable.font = [UIFont systemFontOfSize:20];
        TopLable.textAlignment = NSTextAlignmentCenter;
        [TopLable setTextColor:[UIColor blackColor]];
        [backView addSubview:TopLable];
        
        
        CGFloat topSunY = backView.frame.size.height - 30;
        //ZCJLog(@"%f",topSunY);
        
        UILabel * topSunLable = [[UILabel alloc]initWithFrame:CGRectMake(80, topSunY, topSunStrSize.width, topSunStrSize.height)];
       
        topSunLable.numberOfLines = 0;
        topSunLable.text = topSunStr;
        topSunLable.font = [UIFont systemFontOfSize:13];
        topSunLable.textAlignment = NSTextAlignmentCenter;
        [topSunLable setTextColor:ZCJColor(183, 183, 183)];
        [backView addSubview:topSunLable];
    }
    return self;
}

- (void)awakeFromNib
{
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
